package cn.alterzhang.www.test;


/**
 * Created by zhangshuhan on 2019/1/30.
 */
public class ZkTestClient {

    public static void main(String[] args) throws InterruptedException {
       /* ZkClient zkClient = new ZkClient("198.181.39.68:2181", 5000);
        String path = "/zk-book";

        zkClient.createEphemeral(path, "java编程思想");
        zkClient.subscribeDataChanges(path, new IZkDataListener() {
            @Override
            public void handleDataChange(String dataPath, Object data) throws Exception {
                System.out.println("handleDataChange==dataPath" + path + ",data:" + data);
            }

            @Override
            public void handleDataDeleted(String dataPath) throws Exception {
                System.out.println("handleDataDeleted==dataPath" + path);
            }
        });

        System.out.println(zkClient.readData(path).toString());
        Thread.sleep(5000);
        zkClient.writeData(path,"java编程之美");
        Thread.sleep(5000);
        zkClient.delete(path);
        Thread.sleep(Integer.MAX_VALUE);*/
    }
}
